<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/5/24
 * Time: 15:00
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\common\validate;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        "phone_number" => "require|mobile",
        "code" => "require|integer|length:4",
        "type" => "require|in:1,2"
    ];
    protected $message = [
        "phone_number.require" => "请输入用户手机号",
        "phone_number.mobile" => "手机号格式不正确",
        "code.require" => "验证码必须",
        "code.integer" => "验证码格式不正确",
        "code.length" => "验证码长度为4位",
        "type.require" => "类型必须",
        "type.in" => "类型错误"
    ];
    protected $scene = [
        "sms" => ['phone_number'],
        "login" => ['phone_number', 'code', 'type']
    ];
}